# 高阶函数 返回函数

def createCounter():
    i = 0
    def counter():
        nonlocal i
        i += 1
        return i
    return counter

ca = createCounter()
cb = createCounter()

print([ca(),ca(),ca(),ca(), ca()])
print([cb(),cb(),cb(),cb()])
